import UIKit
import Flutter



@UIApplicationMain
class AppDelegate: FlutterAppDelegate {
    
    override func application( _ application: UIApplication,
                               didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        if #available(iOS 13.0, *) {
            let flutterEngine = FlutterEngine(name: "carplay")
            flutterEngine.run()
            GeneratedPluginRegistrant.register(with: flutterEngine)
            //SceneDelegate和FlutterCarPlaySceneDelegate都要使用，所以先初始化FlutterView
            SceneDelegate.flutterViewController = FlutterViewController.init(engine: flutterEngine, nibName: nil, bundle: nil)
       } else {
            GeneratedPluginRegistrant.register(with: self)
       }

       return super.application(application, didFinishLaunchingWithOptions: launchOptions)
    }
}
